const dev = {
    /** port 端口 */
    serverPort: 84,
    dbConfig: {
        host: '118.31.106.200',
        user: 'root',
        port: '3307',
        password: 'Wtkj@2025',
        database: 'meter',
        waitForConnections: true,
        connectionLimit: 10,
        queueLimit: 0,
    },
    whiteList: ['/api/oper/login', '/api/oprnid/login', '/user/login', '/images', '/api/lsy/notify', '/api/applet/getOpenID', '/api/applet/getPhoneNumber'],
    applet_param: {
        APPID: 'wx8ca3e9cebedef498',
        APPSECRET: '2b74edca707736913a38ac015da3c9f0'
    },
    redisConfig: 'redis://127.0.0.1:6379',
    pay_notify_url: 'http://118.31.106.200:84',
    mqttConfig: {
        host: '47.108.218.17',
        port: 1883,
        username: 'admin',
        password: '!QAZ2wsx',
    }
};

const production = {
    /** port 端口 */
    serverPort: 87,
    dbConfig: {
        host: 'rm-wz9d2pe64fz3z66a83o.mysql.rds.aliyuncs.com',
        user: 'soft_oprt',
        port: '3306',
        password: 'vocation_ca_123',
        database: 'vocation_ca',
        waitForConnections: true,
        connectionLimit: 50,
        queueLimit: 0,
    },
    whiteList: ['/oper/login', '/user/login', '/images', '/fy/notif', '/ad/api/applet/getOpenID'],
    applet_param: {
        APPID: 'wx44f6e36d01b35ebf',
        APPSECRET: 'cf3954aa0d2593ea83fb031faf9f16d0'
    },
};

const local = {
    whiteList: ['/oper/login'],
};

let config = {
    /** port 端口 */
    serverPort: 9961,
    dbConfig: {
        host: 'dev.ktpark.net',
        user: 'root',
        port: '3306',
        password: 'ankuai',
        database: 'bcck',
        waitForConnections: true,
        connectionLimit: 10,
        queueLimit: 0,
    },
    whiteList: ['/oper/login', '/images', '/api/pay_notify', '/api/pay/appletPay', '/applet/queryPrice', '/api/applet/noPlateIn', '/api/lsy/merchant_status_change/notice', '/api/applet/isChannelPay'],
    createNotifyCallBack: 'http://dev.ktpark.net:9961/api/lsy/merchant_status_change/notice',
};

(() => {
    console.log('process.env.NODE_ENV', process.env.NODE_ENV);
    config = {
        ...config,
        ...{ dev, production }[process.env.NODE_ENV || 'dev'],
    };
    //  console.log('config', config);
})();

export default config;
